package com.qf.service.impl;

import com.qf.dao.StudentQueryDao;
import com.qf.dao.impl.StudentQueryDaoImpl;
import com.qf.domain.PageBean;
import com.qf.domain.Student;
import com.qf.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    StudentQueryDao studentQueryDao=new StudentQueryDaoImpl();
    @Override
    public List<Student> query() {
        List<Student> students = studentQueryDao.SelectAllStudent();
        return students;
    }

    @Override
    public PageBean<Student> findListAll(int page_cur, int page_size) {
        long count = studentQueryDao.count();

        List<Student> list = studentQueryDao.findALL(page_cur, page_size);
        PageBean<Student> ds =new PageBean<>(page_cur,page_size,list,(int)count);
        return ds;
    }
}
